package com.tieto.file.service;

import javax.jws.WebParam;

import com.tieto.file.model.File;

public interface FileService {
    /**
     * Returns all users from repository.
     */
    File[] findAll();

    /**
     * Creates a file to repository.
     * 
     * @throws NullPointerException
     *             if file is null.
     */
    File create(@WebParam(name = "file") File file);

    /**
     * Updates a file in repository.
     * 
     * @throws NullPointerException
     *             if file is null.
     * @throws IllegalArgumentException
     *             if file is null.
     */
    File update(@WebParam(name = "file") File file);

    /**
     * Returns a file by id.
     */
    File findOne(@WebParam(name = "id") long id);

    /**
     * Returns true if a file by id exists.
     */
    boolean exists(@WebParam(name = "id") long id);

    /**
     * Deletes a file by id.
     */
    void delete(@WebParam(name = "id") long id);

    /**
     * Returns the count of users in repository.
     */
    long count();
}
